<template>
  <div>
    case1:<input v-model="message1" type="text">
    <hr>
    case2:<input v-model="message2" type="text">
  </div>
</template>

<script setup lang="ts">
 import {ref, watch} from "vue"

 const message1 = ref<string>('小满')
 const message2 = ref<string>('大满')

//  监听单个值 直接使用变量
//  监听多个值 使用数组
 watch([message1, message2], (newVal, oldVal) => {
  console.log(newVal, oldVal)
 })
</script>

<style scoped>

</style>